package com.punch.system.controller;

import com.punch.system.service.HolidayService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.time.LocalDate;
import java.util.List;

/**
 * HolidayController-节假日控制层
 *
 * @author wujj
 * @version 1.0.0
 * @since 2020/7/28 10:32
 */
@RestController
@Api(value = "HolidayController", tags = "节假日")
public class HolidayController {

    @Resource
    private HolidayService holidayService;

    /**
     * 查找一定范围内的节假日
     *
     * @param startDay 开始日期
     * @param endDay   结束日期
     * @return 节假日
     */
    @GetMapping(value = "/holiday", produces = "application/json; charset=utf-8")
    public List<LocalDate> listHoliday(@RequestParam("startDay") LocalDate startDay, @RequestParam("endDay") LocalDate endDay) {
        return holidayService.listHoliday(startDay, endDay);
    }

}
